cmake_minimum_required(VERSION 3.12)
project(OpenCV_Demo)

# 设置C++11标准
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 查找OpenCV包（需要设置OpenCV_DIR环境变量指向你的OpenCV编译目录）
find_package(OpenCV REQUIRED)

# 显示找到的OpenCV版本信息
message(STATUS "OpenCV library status:")
message(STATUS "    version: ${OpenCV_VERSION}")
message(STATUS "    libraries: ${OpenCV_LIBS}")
message(STATUS "    include path: ${OpenCV_INCLUDE_DIRS}")

# 添加可执行文件
add_executable(${PROJECT_NAME} main.cpp)

# 链接OpenCV库
target_link_libraries(${PROJECT_NAME} PRIVATE ${OpenCV_LIBS})

# 包含头文件目录
target_include_directories(${PROJECT_NAME} PRIVATE ${OpenCV_INCLUDE_DIRS})


# cmake_minimum_required(VERSION 3.10)
# project(ImageFinder)

# set(CMAKE_CXX_STANDARD 11)

# # 查找OpenCV
# find_package(OpenCV REQUIRED)
# include_directories(${OpenCV_INCLUDE_DIRS})

# # 添加导出宏定义
# add_definitions(-DIMAGEFINDER_EXPORTS)

# # 创建DLL
# add_library(ImageFinder SHARED ImageFinder.cpp ImageFinder.h)

# # 链接OpenCV库
# target_link_libraries(ImageFinder ${OpenCV_LIBS})